Repository navigation
Conversation
|
Important Review skippedToo many files! This PR contains 568 files, which is 418 over the limit of 150. To get a review, reduce the PR to 150 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files.
|
Attribute reviewAttribute review: 47 tests need review, more than the limit of 25 for one run. Split the change, or ask a maintainer to review the attributes and apply the attribute-review-override label. |
Up to standards ✅🟢 Issues
|
earbona23
left a comment
There was a problem hiding this comment.
The check itself reads well — CustomRootTrust with DisableCertificateDownloads, revocation explicitly off and recorded as off in the output, every X509Certificate2 and X509Chain disposed in a finally, and PathUsesCertificateOutsidePublishedInventory to catch a path that leans on something the inventory never published. Offline is the right call for this, and the result says plainly what it does not assess.
Two things before it can be read, though, and the first is why I started here rather than in the diff.
This pull request carries #2734
GitHub shows 567 files and -18,692 lines against main. Measured locally, almost none of that is yours:
git merge-base --is-ancestor <soulemike/ad-test-consolidation> <codex/ntauth-certificate-chain>
-> true, so this branch contains #2734's commits
git diff --stat <soulemike/ad-test-consolidation> <codex/ntauth-certificate-chain>
-> 5 files changed, 494 insertions(+), 2 deletions(-)
git rev-list --count <soulemike/ad-test-consolidation>..<codex/ntauth-certificate-chain>
-> 3
Your own work is three commits over five files:
| File | |
|---|---|
powershell/internal/services/ad/Get-MtAdNtAuthCertificatePath.ps1 |
+122 |
powershell/tests/functions/AdNtAuthCertificatePath.Tests.ps1 |
+281 |
tests/ad/certificate-services/Test.AD-PKI-13.ps1 |
+55 |
tests/ad/certificate-services/Test.AD-PKI-13.md |
+27 |
powershell/internal/checks/ad/ad/Get-MtAdCertificateInventory.ps1 |
+9/-2 |
The other 562 are @soulemike's AD test consolidation, still open as #2734. Both branches delete the same 182 files under tests/ad/, and all 182 are still present on main, so as it stands this pull request would take the consolidation in under a title about NTAuth paths, and whichever lands first makes the other conflict — which is already why this one shows CONFLICTING.
Rebasing those three commits onto current main would turn this into a five-file review, and it would stop the consolidation being merged twice or reviewed in the wrong thread. If the dependency is real and Get-MtAdCertificateInventory -IncludeRawData only exists after #2734, then retargeting the base at that branch says so explicitly instead of hiding it.
-SkippedCustomReason is dropped here
Test.AD-PKI-13.ps1:
Add-MtTestResultDetail -SkippedBecause NotApplicable -SkippedCustomReason 'The collected NTAuth store contains no CA certificates.'Add-MtTestResultDetail only reads -SkippedCustomReason when -SkippedBecause is Custom (powershell/public/run/Add-MtTestResultDetail.ps1:123-127); every other value takes the else branch and overwrites the reason with Get-MtSkippedReason $SkippedBecause. So that sentence never reaches the operator and the report shows the generic not-applicable text. Nothing else in the repository combines those two — -SkippedBecause Custom appears in 207 places and that is the form that keeps the message.
-SkippedBecause Custom -SkippedCustomReason '...' is what you want, and the empty store deserves the specific wording: it is the difference between "this does not apply to you" and "the store I read was empty".
One question
There is no return after that skip. It does terminate — the helper throws a skip record under the native engine and calls Set-ItResult -Skipped under Pester — so I do not think it is live, but the block below it builds a table over an empty $paths and calls Add-MtTestResultDetail a second time, so a reader has to go and check the helper to know it is unreachable. An explicit return would make it local.
And on the subordinate-CA count: the loop increments after comparing, walking ChainElements from leaf to root, and your comment says this is deliberate because Build treats the target as an end entity. That is the kind of off-by-one that is right until it is not — is there a case in the 281 lines of tests with a three-level path and pathLenConstraint = 0 on the root, where the engine's own InvalidBasicConstraints and your counter should agree?
Summary
Adds AD-PKI-13, an informational native check that verifies CA certificate paths from the forest's NTAuth store to roots published in Active Directory. It handles Microsoft and third-party CA certificates without requiring an enterprise CA registration.
Dependency and review
Depends on #2734. Its integration repairs are offered in soulemike/maester#13, targeting the author's consolidation branch. Current upstream main (
2d659e85) and the repair ancestry are included here; this PR now merges without conflicts.Review the five-file NTAuth increment. Merge #2734 first, including its accepted repairs, then rebase this follow-up onto main. The main-based diff continues to include the consolidation until that dependency lands. Its 90 retired AD IDs originate in #2734; this extension adds AD-PKI-13.
Behavior
CustomRootTrust, published roots as explicit anchors, and published intermediate, enterprise CA and NTAuth certificates as possible issuers. Certificates supplied only by the runner's OS cache cannot make a path verify.Classification and limits
Product=ad,Feature=certificate-services,Area=authentication,ResourceType=CertificateAuthority, Info / Preview,Mitre=None,Control=nist-800-53-r5:SC-17. It supports the certificate-path portion of SC-17 and does not affect scores.No AIA downloads, revocation requests, private-key operations, enrollment or PKINIT are performed. It does not establish organizational root approval, effective DC trust, smart-card/client-auth EKU suitability, certificate mappings, enrollment authorization, template security or the CA's issuance policy. NTAuth authorization and root trust remain separate inputs.
Validation
39cb38919(18 November 2026): scope a justifiedPSUseShouldProcessForStateChangingFunctionssuppression toNew-PathTestCertificate, which creates in-memory test fixtures without changing external state. The explicit rule reports one finding before the annotation and none afterward; default ScriptAnalyzer also reports no findings for the file. All 80 certificate/native-engine cases andBuild-LocalMaester.ps1passed again. Production helpers and the native check are unchanged.cd264a6a3; the certificate test file additionally carries the scoped analyzer suppression above. Atcd264a6a3, 34/34 Windows Server 2025 AD/LDAPS scenarios matched, including all root/depth combinations and multi-valued certificate projection. Those scenarios used the native engine, fresh processes, validated LDAPS and no enterprise CA registrations. No new live-AD run was performed for these integration and analyzer changes.Sources: NTAuth publication, third-party CA authentication prerequisites, .NET chain policy.
Ready for incremental review. #2734 retains its own draft/live-validation and AD-FOR-03 review requirements; the documented dependency and merge order still apply.